package com.demo;

import com.tydic.utils.LogUtil;

public class T_ThreadDemo {
    public static void main(String[] args) {

        Thread t = new Thread(new MyDemoThread());
//        t.setName("AAA");
        t.start();

        try {
            t.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        LogUtil.info("AAA {}", t.isAlive());
    }
}

class MyDemoThread extends Thread{
    public MyDemoThread() {
        LogUtil.info(this.getName());
        LogUtil.info(Thread.currentThread().getName());
        LogUtil.info("{}",Thread.currentThread().isAlive());
    }

    @Override
    public void run() {
        LogUtil.info(this.getName());
        LogUtil.info(Thread.currentThread().getName());
        LogUtil.info("{}",Thread.currentThread().isAlive());
    }
}
